{% extends "../inc/base.html" %}
{% block content %}
<!--
PAGE HEADER

CLASSES:
.page-header-xs	= 20px margins
.page-header-md	= 50px margins
.page-header-lg	= 80px margins
.page-header-xlg= 130px margins
.dark			= dark page header

.shadow-before-1 	= shadow 1 header top
.shadow-after-1 	= shadow 1 header bottom
.shadow-before-2 	= shadow 2 header top
.shadow-after-2 	= shadow 2 header bottom
.shadow-before-3 	= shadow 3 header top
.shadow-after-3 	= shadow 3 header bottom
-->
<section class="page-header dark page-header-xs parallax parallax-2" style="background-image:url('/static/assets/images/demo/panorama/2-min.jpg')">
<div class="overlay dark-2"><!-- dark overlay [1 to 9 opacity] --></div>
<div class="container">

<h1>{{category.title}}</h1>

<!-- breadcrumbs -->
<ol class="breadcrumb f-14">
<li><a href="/">首页</a></li>
{%for val in breadcrumb %}
{% if val.id == category.id %}
<li class="active">{{val.title}}</li>
{% else %}
<li><a href="{{val.url}}">{{val.title}}</a></li>

{% endif %}
{% endfor %}
</ol><!-- /breadcrumbs -->
<!-- page tabs -->
{%column data="cate",pid=category.pid%}
{%if cate%}
<ul class="page-header-tabs list-inline">

<!--<li class="active"><a href="portfolio-masonry-3-columns.html">With Gutter</a></li>-->
{%for val in cate%}
<li  {%if val.id == category.id %}class="active"{%endif%}><a href="{{val.url}}{{http.config('view.file_ext')}}">{{val.name}}</a></li>
{%endfor%}
</ul>
{%endif%}
<!-- /page tabs -->
</div>
</section>
<!-- /PAGE HEADER -->
<!-- -->
{%set cate = category.id|get_cate()%}
<section>
<div class="container">

    <!--分类信息-->
    {%if sort%}
    {%if sort.types|length >1%}
    <ul class="nav nav-tabs">
        {%for val in sort.types%}
        <li class="{%if sortid == val.enable%}active{%endif%}"><a href="{{cate.url}}-{{order}}-{{group_id}}-{{val.enable}}{{http.config('view.file_ext')}}" >{{val.name}}</a></li>
        {%endfor%}

    </ul>
    {%endif%}
    <div class="tab-content table-bordered" style="padding: 0; margin-bottom: 20px; margin-top: -1px">
        <table class="table table-hover  m-b-none" style="margin-top: -1px">
            <tbody>
            {% set typenum = 1%}
            {%for val in typevar%}
            {%if val.search > 1 and val.available==1%}
            <tr {% if typenum > 3 %} class="type_tr_m"  style="display:none"{%endif%} >
                <td style="width: 120px" class="text-right">
                    {{val.option.title}}:
                </td>
                <td>
                    {%if 0 == nsobj[val.option.identifier] or null == nsobj[val.option.identifier]%}
                    <span class="btn btn-danger btn-xs relative">全部</span>
                    {%else%}
                    <a href="{{cate.url}}-{{order}}-{{group_id}}-{{sortid}}-{{0|sort_url(val.option.identifier,typevar,nsobj)}}{{http.config('view.file_ext')}}" class="btn btn-clean btn-xs relative" >全部</a>
                    {%endif%}
                    {%for v in val.rules %}
                    {%if v.id|sort_act(nsobj[val.option.identifier])%}
                    <span class="btn btn-danger btn-xs relative" >{{v.name}}{{val.option.unit}}</span>
                    {%else%}
                    <a href="{{cate.url}}-{{order}}-{{group_id}}-{{sortid}}-{{v.id|sort_url(val.option.identifier,typevar,nsobj)}}{{http.config('view.file_ext')}}" class="btn btn-clean btn-xs relative" >{{v.name}}{{val.option.unit}}</a>
                    {%endif%}
                    {%endfor%}
                    <!--子栏目-->
                    {%for v in val.rules %}
                    {%if v.id|sort_act(nsobj[val.option.identifier])%}
                    {% if v.children%}
                    <div class="subtsm">

                        {% for v_ in v.children %}
                        {%if v_.id|sort_act(nsobj[val.option.identifier])%}
                        <span class="btn btn-danger btn-xs relative" >{{v_.name}}{{val.option.unit}}</span>
                        {%else%}
                        <a href="{{cate.url}}-{{order}}-{{group_id}}-{{sortid}}-{{v_.id|sort_url(val.option.identifier,typevar,nsobj)}}{{http.config('view.file_ext')}}" class="btn btn-clean btn-xs relative">{{v_.name}}{{val.option.unit}}</a>
                        {%endif%}
                        {% endfor %}
                    </div>
                    {%endif%}
                    {%endif%}
                    {%endfor%}
                    <!--子栏目-->
                    {%for v in val.rules %}
                    {%if v.id|sort_act(nsobj[val.option.identifier])%}
                    {% if v.children%}

                    {% for v_ in v.children %}
                    {%if v_.id|sort_act(nsobj[val.option.identifier])%}
                    {% if v_.children%}
                    <div class="subtsm">
                        {% for v__ in v_.children %}

                        {%if v__.id|sort_act(nsobj[val.option.identifier])%}

                        <span class="btn btn-danger btn-xs relative" >{{v__.name}}{{val.option.unit}}</span>
                        {%else%}
                        <a href="{{cate.url}}-{{order}}-{{group_id}}-{{sortid}}-{{v__.id|sort_url(val.option.identifier,typevar,nsobj)}}{{http.config('view.file_ext')}}" class="btn btn-clean btn-xs relative" >{{v__.name}}{{val.option.unit}}</a>

                        {%endif%}
                        {%endfor%}
                    </div>
                    {%endif%}
                    {%endif%}
                    {% endfor %}

                    {%endif%}
                    {%endif%}
                    {%endfor%}
                </td>

            </tr>
            {% set typenum = typenum+1%}
            {%endif%}
            {%endfor%}

            </tbody>
        </table>
        {% if typenum > 4%}
        <a href="javascript:;" class="center-block btn btn-xs btn-white type_tr_b1" style="border-top: 1px solid #cfd8e1; display: block"><span class="fa fa-chevron-down"></span></a>
        <a href="javascript:;" class="center-block btn btn-xs btn-white type_tr_b2" style="border-top: 1px solid #cfd8e1; display: none"><span class="fa fa-chevron-up"></span></a>
        {%endif%}
    </div>

    {%endif%}
    <!--/分类信息-->
<div class="row">

<!-- LEFT -->
    <div class="col-md-9 col-sm-9">
        <div class="text-left">
            <ul class="nav nav-pills mix-filter">

                <li class="filter {%if group_id==0%}active{%endif%}"><a href="{{cate.url}}{{http.config('view.file_ext')}}">全部</a></li>
                {% groups data="groups",cid=category.id%}
                {%for v in groups%}
                <li class="filter {%if group_id==v.id%}active{%endif%}"><a href="{{cate.url}}-{{order}}-{{v.id}}{%if sort%}-{{sortid}}{%endif%}{%if sorturl %}-{%endif%}{{sorturl}}{{http.config('view.file_ext')}}">{{v.name}}</a></li>
                {%endfor%}
            </ul>
            <!--投稿按钮-->
            <div class="btn-group btn-group-sm pull-right">
                <a {%if model|length> 1 %} data-toggle="dropdown" {% endif %} class="btn btn-primary btn-sm document_add
                    dropdown-toggle {% if allow == 0 %}disabled{% endif %}" {%if model|length
                    == 1 %} href="/uc/publish/add/model_id/{{modellist[0].id}}/pid/0/cate_id/{{cate.id}}/group_id/{{group_id}}/sortid/{{sortid}}"{%endif%}
                    ><span class="fa fa-pencil-square-o"></span> 投稿 {%if model|length > 1 %}<span class="caret"></span>{% endif %}</a>
                {%if model|length > 1 %}
                <ul class="dropdown-menu">

                    {% for val in modellist%}
                    <li> <a href="/uc/publish/add/model_id/{{val.id}}/pid/0/cate_id/{{cate.id}}/group_id/{{group_id}}/sortid/{{sortid}}"
                            class="text-info">添加{{val.title}}</a></li>
                    {% endfor %}

                    <!--<li class="divider"></li>-->
                    <!--<li><a href="#">添加内容</a></li>-->
                </ul>
                {% endif %}
            </div>
            <!--//投稿按钮-->
            <div class="btn-group btn-group-sm pull-right">
                <a class="btn btn-default height-auto {%if order<2%}active{%endif%}" href="{{cate.url}}-{%if order<2%}{{1-order}}{%else%}0{%endif%}{%if group_id or sort%}-{{group_id}}{%endif%}{%if sort%}-{{sortid}}{%endif%}{%if sorturl %}-{%endif%}{{sorturl}}{{http.config('view.file_ext')}}" >按时间 <span class="glyphicon {%if order ==0%}glyphicon-arrow-down{%elif order==1%}glyphicon-arrow-up{%else%}glyphicon-arrow-down{%endif%}"></span> </a>
                <a class="btn btn-default height-auto {%if order>=2%}active{%endif%}" href="{{cate.url}}-{%if order>=2%}{%if order ==2%}3{%else%}2{%endif%}{%else%}2{%endif%}{%if group_id or sort%}-{{group_id}}{%endif%}{%if sort%}-{{sortid}}{%endif%}{%if sorturl %}-{%endif%}{{sorturl}}{{http.config('view.file_ext')}}" style="height: auto">按人气<span class="glyphicon  {%if order ==2%}glyphicon-arrow-down{%elif order==3%}glyphicon-arrow-up{%else%}glyphicon-arrow-down{%endif%}"></span></a>
            </div>
            <div class="divider divider-circle divider-center margin-top-0"><!-- divider -->
                <a href="#"><i class="fa fa-rss"></i></a>
            </div>
        </div>

        <div id="portfolio" class="portfolio-gutter portfolio-title-over">
<div class="row">
    {% for val in list %}
    <div class="col-md-4 col-sm-4 mix "><!-- item -->

        <div class="item-box">
            <figure>
										<span class="item-hover">
											<span class="overlay dark-5"></span>
											<span class="inner">

												<!-- lightbox -->
												<a class="ico-rounded lightbox" href="{{val.cover_id|get_pic('')}}" data-plugin-options='{"type":"image"}'>
													<span class="fa fa-plus size-20"></span>
												</a>

                                                <!-- details -->
												<a class="ico-rounded" href="{{val.name|get_url(val.id)}}" target="_blank">
													<span class="glyphicon glyphicon-option-horizontal size-20"></span>
												</a>

											</span>
										</span>

                <!-- overlay title -->
                <div class="item-box-overlay-title">
                    <h3 class="size-14">{{val.title|block(16)}}</h3>
                    <ul class="list-inline categories nomargin">
                        <li><a href="#"><i class="fa fa-clock-o"></i>
                            <span class="font-lato">{{val.update_time|dateformat('Y-m-d H:i')}}</span></a></li>
                        <li><a href="#"><i class="fa fa-eye"></i>
                            <span class="font-lato">{{val.view}}</span></a></li>
                        <li><a href="#">
                            <i class="fa fa-user"></i>
                            <span class="font-lato">{{val.uid|get_nickname}}</span>
                        </a></li>
                    </ul>
                </div><!-- /overlay title -->

                <img class="img-responsive" src="{{val.cover_id|get_pic('m=1,w=600,h=399')}}" width="600" height="399" alt="">
            </figure>
        </div>

    </div><!-- /item -->
    {%endfor%}
</div>
            </div>




        <!-- PAGINATION -->
        <div class="text-left">
            <!-- Pagination Default -->
            {{pagination | safe}}
            <!-- /Pagination Default -->
        </div>
        <!-- /PAGINATION -->

    </div>

<!-- RIGHT -->

    <div class="col-md-3 col-sm-3">

        <!-- INLINE SEARCH -->
        <div class="inline-search clearfix margin-bottom-30">
            <form action="" method="get" class="widget_search">
                <input type="search" placeholder="Start Searching..." id="s" name="s" class="serch-input">
                <button type="submit">
                    <i class="fa fa-search"></i>
                </button>
            </form>
        </div>
        <!-- /INLINE SEARCH -->

        <hr />
{#
        <!-- side navigation -->
        {%column data="cates",cid=category.id,isnum="1"%}
        {%if ccates%}
        <div class="side-nav margin-bottom-20 margin-top-20">
            <div class="side-nav-head">
                <button class="fa fa-bars"></button>
                <h4>{{category.title}} 子分类</h4>
            </div>
            <ul class="list-group list-group-bordered list-group-noicon uppercase">
                {%for val in cates%}
                <li class="list-group-item"><a href="{{val.url}}"><span class="size-11 text-muted pull-right">({{val.doc_num}})</span> {{val.name}}</a></li>
                {%endfor%}
            </ul>
            <!-- /side navigation -->
        </div>
        {%endif%}

#}
        <!-- JUSTIFIED TAB -->
        <div class="tabs nomargin-top hidden-xs margin-bottom-10">

            <!-- tabs -->
            <ul class="nav nav-tabs nav-bottom-border nav-justified">
                <li class="active">
                    <a href="#tab_1" data-toggle="tab">
                        最热
                    </a>
                </li>
                <li>
                    <a href="#tab_2" data-toggle="tab">
                        最新
                    </a>
                </li>
            </ul>

            <!-- tabs content -->
            <div class="tab-content margin-bottom-0 margin-top-10">

                <!-- POPULAR -->
                <div id="tab_1" class="tab-pane active">
                    <!-- /post -->
                    {% topic data = "hotlist",limit= "5",cid=category.id,type="hot"%}
                    {%for v in hotlist%}
                    <div class="row tab-post"><!-- post -->
                        {%if v.cover_id%}
                        <div class="col-md-3 col-sm-3 col-xs-3">
                            <a href="{{v.name|get_url(v.id)}}">
                                <img src="{{v.cover_id|get_pic('m=1,w=50,h=50')}}" width="50" alt="" />
                            </a>
                        </div>
                        {%endif%}
                        <div class="col-md-9 col-sm-9 col-xs-9">
                            <a href="{{v.name|get_url(v.id)}}" class="tab-post-link">{{v.title}}</a>
                            <small>{{v.update_time|dateformat('Y-m-d H:i')}}</small>
                        </div>
                    </div><!-- /post -->
                    {%endfor%}

                </div>
                <!-- /POPULAR -->


                <!-- RECENT -->
                <div id="tab_2" class="tab-pane">
                    {% topic data = "newlist",limit= "5",cid=category.id%}
                    {%for v in newlist%}
                    <div class="row tab-post"><!-- post -->
                        {%if v.cover_id%}
                        <div class="col-md-3 col-sm-3 col-xs-3">
                            <a href="{{v.name|get_url(v.id)}}">
                                <img src="{{v.cover_id|get_pic('m=1,w=50,h=50')}}" width="50" alt="" />
                            </a>
                        </div>
                        {%endif%}
                        <div class="col-md-9 col-sm-9 col-xs-9">
                            <a href="{{v.name|get_url(v.id)}}" class="tab-post-link">{{v.title}}</a>
                            <small>{{v.update_time|dateformat('Y-m-d H:i')}}</small>
                        </div>
                    </div><!-- /post -->
                    {%endfor%}
                    <!-- /post -->
                </div>
                <!-- /RECENT -->

            </div>

        </div>
        <!-- JUSTIFIED TAB -->


        <!-- TAGS -->
        <h3 class="hidden-xs size-16 margin-bottom-10">标签</h3>
        <div class="hidden-xs margin-bottom-20">
            {% keywords data ="kws",type="hot"%}
            {%for key in kws%}
            <a class="tag" href="{{key.url}}">
                <span class="txt">{{key.keyname}}</span>
                <span class="num">{{key.videonum}}</span>
            </a>
            {%endfor%}
        </div>



        <hr />


        <!-- SOCIAL ICONS -->
        <div class="hidden-xs margin-top-30 margin-bottom-60">
            <a href="#" class="social-icon social-icon-border social-facebook pull-left" data-toggle="tooltip" data-placement="top" title="Facebook">
                <i class="icon-facebook"></i>
                <i class="icon-facebook"></i>
            </a>

            <a href="#" class="social-icon social-icon-border social-twitter pull-left" data-toggle="tooltip" data-placement="top" title="Twitter">
                <i class="icon-twitter"></i>
                <i class="icon-twitter"></i>
            </a>

            <a href="#" class="social-icon social-icon-border social-gplus pull-left" data-toggle="tooltip" data-placement="top" title="Google plus">
                <i class="icon-gplus"></i>
                <i class="icon-gplus"></i>
            </a>

            <a href="#" class="social-icon social-icon-border social-linkedin pull-left" data-toggle="tooltip" data-placement="top" title="Linkedin">
                <i class="icon-linkedin"></i>
                <i class="icon-linkedin"></i>
            </a>

            <a href="#" class="social-icon social-icon-border social-rss pull-left" data-toggle="tooltip" data-placement="top" title="Rss">
                <i class="icon-rss"></i>
                <i class="icon-rss"></i>
            </a>
        </div>

    </div>
</div>

</div>
</section>
<!-- / -->
{% endblock %}